// 健康管理--病虫害防治    TODO:要替换的
import axios from "@/api/axios";
export default {
  // 获取表格TODO:
  getList(params) {
    return axios.post("/v3/patrol/insectPrevent/queryPageList", {
      ...params
    });
  },
  // 获取批次
  getAllBatchList(params) {
    return axios.post('/v3/batch/productionBatch/queryByCondition', {
      farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
      organizationNo: sessionStorage.getItem("organizationNo"),
      ...params,
      // status: 0
    });
  },
  // 根据批次查地块
  queryFacility(no) {
    return axios.get(`/v3/batch/productionBatch/findFacilityByBatchNo?no=${no}`)
  },
  // 获取药品列表TODO:
  getMedicineList(params) {
    return axios.post("/v3/templateTenant/material/queryByCondition", {
      organizationNo: sessionStorage.organizationNo
    });
  },
  // 查询员工 暂时修改
  getEmployeeList(no) {
    return axios.post("/v3/organization/personDepartmentMapper/queryByCondition", {
      postNo: no,
      organizationNo: sessionStorage.organizationNo
    });
  },
  // 添加
  add(params) {
    return axios.post('/v3/patrol/insectPrevent/add',{
      ...params
    })
  },
  // 删除
  del(no) {
    return axios.delete(`/v3/patrol/insectPrevent/del?id=${no}`,)
  },
  // 批量删除
  delList(ids) {
    return axios.delete(`/v3/patrol/insectPrevent/delList?ids=${ids}`)
  },
  edit(params) {
    return axios.put('/v3/patrol/insectPrevent/edit',{...params})
  },
  // 查询图片
  queryPicture(id) {
    return axios.get(`v3/patrol/picture/query?pictureId=${id}`)
  },
  // 防治-批次汇总
  queryBatchNoPageList(params) {
    return axios.post('/v3/patrol/insectPrevent/queryBatchNoPageList',{
      ...params
    })
  },
};

